#ifndef _MB_PARAMETERSDEF_H_
#define _MB_PARAMETERSDEF_H_
/**
 *Copyright(C),2024, Ningbo Tuopu Group Co., Ltd.
 *FileName:   MotAsp_Cfg_I.h
 *Date:       2024-12-16 19:03:04
 *Author:     TianGui.Wang
 *Version:    0
 *Path:
 *Description:
 */
/****************************************************************************/
/*                             Include area                                 */
/****************************************************************************/

/****************************************************************************/
/*                             Definition area                              */
/****************************************************************************/

/************************************************************* Mot ************************************************************* */
#define MB_PARA_MOT_DEF_POLES                           (6)        /*Number of pole pairs of the motor*/                 
#define MB_PARA_MOT_DEF_SCREAW_LEAD                     (500)      /*Screw lead*/                     
#define MB_PARA_MOT_DEF_MAX_SPD_RPM                     (30000)    /*The maximum speed of the motor is 0.1mps*/                                 
#define MB_PARA_MOT_DEF_V_OV_SAFETY_POINT               (5800)     /*Motor overvoltage protection point*/                         
#define MB_PARA_MOT_DEF_V_OV_RST_POINT                  (5650)     /*Motor overvoltage recovery point*/                                                              
#define MB_PARA_MOT_DEF_V_UV_SAFETY_POINT               (3550)     /*Motor undervoltage protection point*/                                                                        
#define MB_PARA_MOT_DEF_V_UV_RST_POINT                  (3750)     /*The motor undervoltage recovery point*/                                                                               
#define MB_PARA_MOT_DEF_T_OV_SAFETY_POINT               (1400)     /*Motor over-temperature protection point*/                                                           
#define MB_PARA_MOT_DEF_T_UV_SAFETY_POINT               (1250)     /*Motor overtemperature recovery point*/                               
#define MB_PARA_MOT_DEF_MAX_PHASE_CURRENT               (155)      /*The maximum phase current of the motor*/                                 

/************************************************************* Ctrl ************************************************************* */
#define MB_PARA_CTRL_DEF_UP_SPD_LOOP_KP                 (1200000)  /*Ascending velocity ring Kp*/                                                                               
#define MB_PARA_CTRL_DEF_UP_SPD_LOOP_KI                 (1400)     /*Ascending speed ring Ki*/                                                                                    
#define MB_PARA_CTRL_DEF_UP_POS_LOOP_KP                 (2000000)  /*Ascending position ring Kp*/                                                                                                           
#define MB_PARA_CTRL_DEF_UP_POS_LOOP_KI                 (0)        /*Ascending position ring Ki*/                                                     
#define MB_PARA_CTRL_DEF_UP_POS_LOOP_KD                 (0)        /*Ascending position ring Kd*/                                                                                    
#define MB_PARA_CTRL_DEF_DOWN_SPD_LOOP_KP               (1200000)  /*Descent speed ring Kp*/                                                                                      
#define MB_PARA_CTRL_DEF_DOWN_SPD_LOOP_KI               (1400)     /*Descending speed ring Ki*/                                                                                      
#define MB_PARA_CTRL_DEF_DOWN_POS_LOOP_KP               (2000000)  /*Descending position ring Kp*/                                                                                       
#define MB_PARA_CTRL_DEF_DOWN_POS_LOOP_KI               (0)        /*Descending position ring Ki*/                                                      
#define MB_PARA_CTRL_DEF_DOWN_POS_LOOP_KD               (0)        /*Descending position ring Kd*/                                                                                                
#define MB_PARA_CTRL_DEF_STALL_TIME                     (2000)     /*Stall time*/                                                                            
#define MB_PARA_CTRL_DEF_STALL_CURRENT                  (139500)   /*Motor stall current*/                                                                         
#define MB_PARA_CTRL_DEF_SPEED_LIMIT                    (28000)    /*Speed limit*/                                                                                    
#define MB_PARA_CTRL_DEF_TRAVEL_UP_LIMIT                (8000)     /*Travel cap*/                                                                                               
#define MB_PARA_CTRL_DEF_TRAVEL_DOWN_LIMIT              (0)        /*Minimum itinerary*/                                                                         

/************************************************************* Asp ************************************************************* */
#define MB_PARA_ASP_DEF_E_ANGLE_ZERO                    (0)        /*Electrical angle zero value*/                                                                      
#define MB_PARA_ASP_DEF_E_ANGLE_STATE                   (2)        /*Electrical angle zero state*/                                                               
#define MB_PARA_ASP_DEF_M_ANGLE_ZERO                    (0)        /*Mechanical zero value*/                                                                             
#define MB_PARA_ASP_DEF_M_ANGLE_STATE                   (2)        /*Mechanical zero status*/                                                                    
#define MB_PARA_ASP_DEF_POS_ZERO                        (0)        /*Position zero value*/                                     
#define MB_PARA_ASP_DEF_POS_STATE                       (2)        /*Position zero status*/                                                      
#define MB_PARA_ASP_DEF_CURR_POS                        (0)        /*The current position value*/                                                              

/************************************************************* Foc ************************************************************* */
#define MB_PARA_FOC_DEF_CURRENT_LOOP_ID_KP              (26000)    /*Current loop IdKp*/                                                            
#define MB_PARA_FOC_DEF_CURRENT_LOOP_ID_KP              (900)      /*Current loop IdKi*/                                                               
#define MB_PARA_FOC_DEF_CURRENT_LOOP_IQ_KP              (26000)    /*Current loop IqKp*/                                                                   
#define MB_PARA_FOC_DEF_CURRENT_LOOP_IQ_KP              (900)      /*Current loop IqKi*/                                                           
#define MB_PARA_FOC_DEF_ECU_T_OV_SAFETY_POINT           (155)      /*Motor overcurrent recovery point*/                                             
#define MB_PARA_FOC_DEF_ECU_T_OV_RST_POINT              (155)      /*Motor overcurrent protection point*/                                     

/************************************************************* Common ************************************************************* */
#define MB_PARA_COMMON_DEF_NODE_ID                     (0)        /*NODE ID*/                                                                         
#define MB_PARA_COMMON_DEF_ECU_V_OV_SAFETY_POINT       (5800)     /*ECU overvoltage recovery point*/                                                        
#define MB_PARA_COMMON_DEF_ECU_V_OV_RST_POINT          (3550)     /*ECU overvoltage point*/                                                                       
#define MB_PARA_COMMON_DEF_ECU_V_UV_SAFETY_POINT       (5650)     /*ECU undervoltage recovery point*/                                                                            
#define MB_PARA_COMMON_DEF_ECU_V_UV_RST_POINT          (3750)     /*ECU undervoltage point*/                                                                         
#define MB_PARA_COMMON_DEF_ECU_T_OV_SAFETY_POINT       (850)      /*ECU over-temperature protection point*/                                                                               
#define MB_PARA_COMMON_DEF_ECU_T_UV_SAFETY_POINT       (750)      /*ECU overtemperature recovery point*/                                                                                 




/****************************************************************************/
/*                             Typedef area                                 */
/****************************************************************************/

/****************************************************************************/
/*                             Local data at RAM                            */
/****************************************************************************/

/****************************************************************************/
/*                             Global data at RAM                           */
/****************************************************************************/

/****************************************************************************/
/*                        Global data at RAM declare area                   */
/****************************************************************************/

/****************************************************************************/
/*                             Local data at ROM                            */
/****************************************************************************/

/****************************************************************************/
/*                             Global data at ROM                           */
/****************************************************************************/

/****************************************************************************/
/*                        Global data at ROM declare area                   */
/****************************************************************************/

/****************************************************************************/
/*                        Local function declare area                       */
/****************************************************************************/

/****************************************************************************/
/*                        Global function declare area                      */
/****************************************************************************/

#endif /*_MB_PARAMETERSDEF_H_*/
